package bl.history;

import java.net.MalformedURLException;
import java.rmi.AlreadyBoundException;
import java.rmi.NotBoundException;
import java.rmi.RemoteException;
import java.sql.SQLException;

import server.boot.ServiceLoader;
import vo.BusinessConditionVo;
import client.boot.BLServiceManager;
import blservice.history.经营情况BLService;
import db.Database;

public class 经营情况BLDriver {

	经营情况BLService bl;
	
	public static void main(String[] args) throws RemoteException, MalformedURLException, NotBoundException, SQLException, AlreadyBoundException{
		经营情况BLDriver d=new 经营情况BLDriver();
		d.drive();
	}
	
	void drive() throws RemoteException, MalformedURLException, NotBoundException, SQLException, AlreadyBoundException{
		//环境初始化
		Database.iniDatabase("localhost", 3306, "seac2", "seac2", "seac2");
		ServiceLoader.iniServiceLoader();
		BLServiceManager.setServerIP("localhost");
		bl=BLServiceManager.get经营情况BLService(null);
		
		BusinessConditionVo vo=bl.get经营情况();
		if(vo.isSuccessed()){
			System.out.println(vo.get销售成本());
			System.out.println(vo.get销售收入());
		}else{
			System.out.println(vo.getFailMessage());
		}
		System.exit(0);
	}
}
